﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="ASupportingMaterials.aspx.cs" Inherits="AB.ServiceDirectory.Design.SupportingMaterials.ASupportingMaterials" %>
<%@ Import Namespace="AB.ServiceDirectory" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<script type="text/javascript">
    $(function () {
        $("#tabs").tabs();
    });

    </script>
    <script type="text/javascript" language="Javascript">

        function Confirm_Edit() {

            if (confirm("Do you want to make this Organization active?") == true)
                return true;
            else
                return false;
        }
</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentTitle" runat="server">
  <h2>Organization Details</h2>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="Content" runat="server">

<div class="grid740 simplebox relative">
        <div id="tabs">
            <ul>
                <li>
                    <asp:HyperLink ID="LinkDetails01" NavigateUrl="#DetailsPanel01" runat="server">Details 1</asp:HyperLink></li>
                <li>
                    <asp:HyperLink ID="LinkDetails02" NavigateUrl="#DetailsPanel02" runat="server">Details 2</asp:HyperLink></li>
                <li>
                    <asp:HyperLink ID="LinkDetails03" NavigateUrl="#DetailsPanel03" runat="server" Visible="False">Details 3</asp:HyperLink></li>
                <li>
                    <asp:HyperLink ID="LinkDetails05" NavigateUrl="#DetailsPanel05" runat="server">Details 5</asp:HyperLink></li>
            </ul>
            <span class="top-right-cornor">
                <asp:Button CssClass="st-button" ID="ButtonInactive" runat="server" 
                Text="In-active" CommandName="active" CausesValidation="False" 
                oncommand="ButtonInactive_Command" Visible="False" />
                <asp:Button CssClass="st-button" ID="ButtonSave" runat="server" Text="Save" 
                CommandName="new" oncommand="ButtonSave_Command" />
                <asp:Button CssClass="st-button" ID="ButtonBack" runat="server" Text="Back" PostBackUrl="~/Organisation/OrganisationList.aspx"
                    CausesValidation="False" />
            </span>
            <%--ADDRESS - POSTCODE LOOKUP--%><%--CONTACT LOOKUP--%><%--BUSINESS LOOKUP--%>
            <asp:Panel ID="DetailsPanel01" ClientIDMode="Static" runat="server">
                <%--Mỗi một dòng có đường kẻ ngang là một div với class st-form-line-noleft--%>
                <div class="st-form-line-noleft">
                    <%--Phần bên trái của 1 dòng là 1 label và 1 textbox, checkbox,...--%>
                    <div class="half">
                        <asp:Label ID="LabelOrganizationName" runat="server" Text="Organization Name" CssClass="st-labeltext level1"
                            AssociatedControlID="TextBoxOrganizationName">
                            <asp:RequiredFieldValidator ID="RequiredOrganizationName" runat="server" ErrorMessage="*"
                                SetFocusOnError="true" ForeColor="red" ControlToValidate="TextBoxOrganizationName" />
                        </asp:Label><asp:TextBox ID="TextBoxOrganizationName" CssClass="st-forminput" runat="server"
                            Width="210px"></asp:TextBox><asp:Label ID="LabelNameExists" runat="server" Text=""
                                ForeColor="maroon"></asp:Label></div><%--Phần bên phải tương tự nhưng có thêm class là last--%><div class="half last">
                        <asp:Label ID="LabelPreferredOrganization" runat="server" Text="Preferred Organization"
                            CssClass="st-labeltext level1-5" AssociatedControlID="CheckBoxPreferredOrganization"></asp:Label><asp:CheckBox
                                ID="CheckBoxPreferredOrganization" runat="server" />
                    </div>
                    <%--Bắt buộc phải có phần này sau 2 thẻ div có class là half--%>
                    <div class="clear">
                    </div>
                </div>
                <%--Mỗi một dòng có đường kẻ ngang là một div với class st-form-line-noleft--%>
                <div class="st-form-line-noleft">
                    <div class="half">
                        <asp:Label ID="LabelShortDescription" runat="server" Text="Organization Short Description"
                            CssClass="st-labeltext level1" AssociatedControlID="TextBoxShortDescription">
                            <asp:RequiredFieldValidator ID="RequiredShortDescription" runat="server" ErrorMessage="*"
                                SetFocusOnError="true" ForeColor="red" ControlToValidate="TextBoxShortDescription" />
                        </asp:Label><asp:TextBox ID="TextBoxShortDescription" CssClass="st-forminput" runat="server"
                            Width="210px" TextMode="MultiLine" Rows="3"></asp:TextBox></div><div class="half last">
                        <asp:Label ID="LabelInterest" runat="server" Text="Expression of Interest" CssClass="st-labeltext level1-5"
                            AssociatedControlID="CheckBoxInterest"></asp:Label><asp:CheckBox ID="CheckBoxInterest"
                                runat="server" AutoPostBack="True" /><div
                                    class="clear">
                                </div>
                        <br />
                        <asp:Label ID="LabelTypeOfBusiness" runat="server" Text="Type of Business" CssClass="st-labeltext level1"
                            AssociatedControlID="TextBoxTypeOfBusiness">
                            <asp:RequiredFieldValidator ID="RequiredTypeOfBusiness" runat="server" ErrorMessage="*"
                                SetFocusOnError="true" ForeColor="red" ControlToValidate="TextBoxTypeOfBusiness" />
                        </asp:Label><asp:TextBox ID="TextBoxTypeOfBusiness" CssClass="st-forminput st-disable"
                            runat="server" Width="150px" ReadOnly="True"></asp:TextBox><asp:LinkButton ID="ButtonTypeOfBusinessLookup"
                                runat="server" CssClass="hg-blue" Text="Lookup" CausesValidation="False" CommandName="business"
                                OnCommand="ButtonLookup_Command" /></div>
                    <div class="clear">
                    </div>
                </div>
                <div class="st-form-line-noleft">
                    <div class="half">
                        <asp:Label ID="LabelLeadContact" runat="server" Text="Lead Contact" CssClass="st-labeltext level1"
                            AssociatedControlID="TextBoxLeadContact"></asp:Label><asp:TextBox ID="TextBoxLeadContact"
                                CssClass="st-forminput st-disable" runat="server" Width="150px" ReadOnly="True"></asp:TextBox><asp:LinkButton
                                    ID="ButtonContactLookup" runat="server" CssClass="hg-blue" Text="Lookup" CausesValidation="False"
                                    CommandName="contact" OnCommand="ButtonLookup_Command" />
                        <asp:HiddenField ID="HiddenFieldContactId" runat="server" />
                    </div>
                    <div class="half last">
                        <asp:Label ID="LabelSicCode" runat="server" Text="SIC" CssClass="st-labeltext level1"
                            AssociatedControlID="TextBoxSicCode"></asp:Label><asp:TextBox ID="TextBoxSicCode"
                                CssClass="st-forminput st-disable" runat="server" Width="50px" ReadOnly="True"></asp:TextBox><asp:HiddenField
                                    ID="HiddenFieldBusinessId" runat="server" />
                    </div>
                    <div class="clear">
                    </div>
                </div>
                <div class="st-form-line-noleft">
                    <div class="half">
                        <asp:Label ID="LabelAddressLine1" runat="server" Text="Address Line 1" CssClass="st-labeltext level1"
                            AssociatedControlID="TextBoxAddressLine1">
                            <asp:RequiredFieldValidator ID="RequiredAddressLine1" runat="server" ErrorMessage="*"
                                SetFocusOnError="true" ForeColor="red" ControlToValidate="TextBoxAddressLine1" />
                        </asp:Label><asp:TextBox ID="TextBoxAddressLine1" CssClass="st-forminput" runat="server"
                            Width="210px"></asp:TextBox><br /><br /><asp:Label ID="LabelAddressLine2" runat="server" Text="Address Line 2" CssClass="st-labeltext level1"
                            AssociatedControlID="TextBoxAddressLine2"></asp:Label><asp:TextBox ID="TextBoxAddressLine2"
                                CssClass="st-forminput" runat="server" Width="210px"></asp:TextBox><br /><br /><asp:Label ID="LabelAddressLine3" runat="server" Text="Address Line 3" CssClass="st-labeltext level1"
                            AssociatedControlID="TextBoxAddressLine3"></asp:Label><asp:TextBox ID="TextBoxAddressLine3"
                                CssClass="st-forminput" runat="server" Width="210px"></asp:TextBox></div><div class="half last">
                        <asp:Label ID="LabelFullDescription" runat="server" Text="Full Description" CssClass="st-labeltext level1"
                            AssociatedControlID="TextBoxFullDescription"></asp:Label><asp:TextBox ID="TextBoxFullDescription"
                                CssClass="st-forminput" runat="server" Width="210px" TextMode="MultiLine" Rows="3"></asp:TextBox><br /><br /><asp:Label ID="LabelPhoneNumber" runat="server" Text="Phone Number" CssClass="st-labeltext level1"
                            AssociatedControlID="TextBoxPhoneNumber">
                            <asp:RequiredFieldValidator ID="RequiredPhoneNumber" runat="server" ErrorMessage="*"
                                SetFocusOnError="true" ForeColor="red" ControlToValidate="TextBoxPhoneNumber" />
                        </asp:Label><asp:TextBox ID="TextBoxPhoneNumber" CssClass="st-forminput" runat="server"
                            Width="210px"></asp:TextBox></div><div class="clear">
                    </div>
                </div>
                <div class="st-form-line-noleft">
                    <div class="half">
                        <asp:Label ID="LabelPostcode" runat="server" Text="Postcode" CssClass="st-labeltext level1"
                            AssociatedControlID="TextBoxPostcode">
                            <asp:RequiredFieldValidator ID="RequiredPostcode" runat="server" ErrorMessage="*"
                                SetFocusOnError="true" ForeColor="red" ControlToValidate="TextBoxPostcode" />
                        </asp:Label><asp:TextBox ID="TextBoxPostcode" CssClass="st-forminput st-disable"
                            runat="server" ReadOnly="true" Width="150px"></asp:TextBox><asp:LinkButton ID="ButtonPostcodeLookup"
                                runat="server" CssClass="hg-blue" Text="Lookup" CausesValidation="False" CommandName="postcode"
                                OnCommand="ButtonLookup_Command" /><asp:HiddenField ID="HiddenFieldAddressId" runat="server" />
                    </div>
                    <div class="half last">
                        <asp:Label ID="LabelFax" runat="server" Text="Fax" CssClass="st-labeltext level1"
                            AssociatedControlID="TextBoxFax">  </asp:Label><asp:TextBox ID="TextBoxFax" CssClass="st-forminput"
                                runat="server" Width="210px"></asp:TextBox></div><div class="clear">
                    </div>
                </div>
                <div class="st-form-line-noleft">
                    <div class="half">
                        <asp:Label ID="LabelCityTown" runat="server" Text="City/Town" CssClass="st-labeltext level1"
                            AssociatedControlID="TextBoxCityTown"></asp:Label><asp:TextBox ID="TextBoxCityTown"
                                CssClass="st-forminput" runat="server" Width="210px"></asp:TextBox></div><div class="half last">
                        <asp:Label ID="LabelEmail" runat="server" Text="Email" CssClass="st-labeltext level1"
                            AssociatedControlID="TextBoxEmail"></asp:Label><asp:TextBox ID="TextBoxEmail" CssClass="st-forminput"
                                runat="server" Width="210px"></asp:TextBox></div><div class="clear">
                    </div>
                </div>
                <div class="st-form-line-noleft">
                    <div class="half">
                        <asp:Label ID="LabelCounty" runat="server" Text="County" CssClass="st-labeltext level1"
                            AssociatedControlID="TextBoxCounty"></asp:Label><asp:TextBox ID="TextBoxCounty" CssClass="st-forminput"
                                runat="server" Width="210px"></asp:TextBox></div><div class="half last">
                        <asp:Label ID="LabelWebAddress" runat="server" Text="Web Address" CssClass="st-labeltext level1"
                            AssociatedControlID="TextBoxWebAddress"></asp:Label><asp:TextBox ID="TextBoxWebAddress"
                                CssClass="st-forminput" runat="server" Width="210px"></asp:TextBox></div><div class="clear">
                    </div>
                </div>
                <div class="st-form-line-noleft">
                    <div class="half">
                        <asp:Label ID="LabelNationCounty" runat="server" Text="Nation County" CssClass="st-labeltext level1"
                            AssociatedControlID="DropDownListNationCounty"></asp:Label><asp:DropDownList ID="DropDownListNationCounty"
                                DataTextField="CountryName" DataValueField="CountryId" runat="server" CssClass="st-forminput"
                                Width="220px">
                            </asp:DropDownList>
                    </div>
                    <div class="half last">
                        <asp:Label ID="LabelCharityNumber" runat="server" Text="Charity Number" CssClass="st-labeltext level1"
                            AssociatedControlID="TextBoxCharityNumber"></asp:Label><asp:TextBox ID="TextBoxCharityNumber"
                                CssClass="st-forminput" runat="server" Width="210px"></asp:TextBox></div><div class="clear">
                    </div>
                </div>
                <div class="st-form-line-noleft">
                    <div class="half">
                        &nbsp; </div><div class="half last">
                        <asp:Label ID="LabelCompanyNumber" runat="server" Text="Company Number" CssClass="st-labeltext level1"
                            AssociatedControlID="TextBoxCompanyNumber"></asp:Label><asp:TextBox ID="TextBoxCompanyNumber"
                                CssClass="st-forminput" runat="server" Width="210px"></asp:TextBox></div><div class="clear">
                    </div>
                </div>
            </asp:Panel>
            <%--ADDRESS - POSTCODE LOOKUP--%><asp:Panel ID="DetailsPanel02" ClientIDMode="Static" runat="server">
                <div class="st-form-line-noleft">
                    <div class="half">
                        <asp:Label ID="LabelOrgSpecial" runat="server" Text="Organization Specialism"
                            CssClass="st-labeltext level1" AssociatedControlID="CheckBoxListOrgSpecial"></asp:Label><div
                                class="st-forminput left check-box-list">
                                <asp:CheckBoxList ID="CheckBoxListOrgSpecial" runat="server" DataTextField="ItemName"
                                    DataValueField="Id">
                                </asp:CheckBoxList>
                            </div>
                    </div>
                    <div class="half last">
                        <asp:Label ID="Label1" runat="server" Text="Service Personal Circumstances Capabilities"
                            CssClass="st-labeltext level1 checked-box-list" AssociatedControlID="CheckBoxListCircumstances"></asp:Label><div
                                class="st-forminput left check-box-list">
                                <asp:CheckBoxList ID="CheckBoxListCircumstances" runat="server" DataTextField="ItemName"
                                    DataValueField="Id">
                                </asp:CheckBoxList>
                            </div>
                    </div>
                    <div class="clear">
                    </div>
                </div>
                <div class="st-form-line-noleft">
                    <div class="half">
                        <asp:Label ID="Label2" runat="server" Text="Service Disabilities Capabilities" CssClass="st-labeltext level1"
                            AssociatedControlID="CheckBoxListOrgSpecial"></asp:Label><div class="st-forminput left check-box-list">
                                <asp:CheckBoxList ID="CheckBoxListDisabilities" runat="server" DataTextField="ItemName"
                                    DataValueField="Id">
                                </asp:CheckBoxList>
                            </div>
                    </div>
                    <div class="half last">
                        <asp:Label ID="Label3" runat="server" Text="Service Ethnicity Capabilities" CssClass="st-labeltext level1"
                            AssociatedControlID="CheckBoxListCircumstances"></asp:Label><div class="st-forminput left check-box-list">
                                <asp:CheckBoxList ID="CheckBoxListEthnicity" runat="server" DataTextField="ItemName"
                                    DataValueField="Id">
                                </asp:CheckBoxList>
                            </div>
                    </div>
                    <div class="clear">
                    </div>
                </div>
                <div class="st-form-line-noleft">
                    <div class="half">
                        <asp:Label ID="Label4" runat="server" Text="Service Barriers Capabilities" CssClass="st-labeltext level1"
                            AssociatedControlID="CheckBoxListBarriers"></asp:Label><div class="st-forminput left check-box-list">
                                <asp:CheckBoxList ID="CheckBoxListBarriers" runat="server" DataTextField="ItemName"
                                    DataValueField="Id">
                                </asp:CheckBoxList>
                            </div>
                    </div>
                    <div class="half last">
                        <asp:Label ID="Label5" runat="server" Text="Accreditation" CssClass="st-labeltext level1"
                            AssociatedControlID="CheckBoxListAccreditation"></asp:Label><div class="st-forminput left check-box-list">
                                <asp:CheckBoxList ID="CheckBoxListAccreditation" runat="server" DataTextField="ItemName"
                                    DataValueField="Id">
                                </asp:CheckBoxList>
                            </div>
                    </div>
                    <div class="clear">
                    </div>
                </div>
                <div class="st-form-line-noleft">
                    <div class="half">
                        <asp:Label ID="Label6" runat="server" Text="Service Benefits Capabilities" CssClass="st-labeltext level1 "
                            AssociatedControlID="CheckBoxListBarriers"></asp:Label><div class="st-forminput left check-box-list">
                                <asp:CheckBoxList ID="CheckBoxListBenefits" runat="server" DataTextField="ItemName"
                                    DataValueField="Id">
                                </asp:CheckBoxList>
                            </div>
                    </div>
                    <div class="clear">
                    </div>
                </div>
            </asp:Panel>
            <%--CONTACT LOOKUP--%><asp:Panel ID="DetailsPanel03" ClientIDMode="Static" runat="server" Visible="False">
                <div class="st-form-line-noleft">
                    <asp:Label ID="LabelPrograms" runat="server" Text="EOI Programs" CssClass="st-labeltext level1"
                        AssociatedControlID="CheckBoxListPrograms"></asp:Label><div class="st-forminput left check-box-list level2-5">
                            <asp:CheckBoxList ID="CheckBoxListPrograms" runat="server" DataTextField="ProgramName"
                                DataValueField="ProgramId">
                            </asp:CheckBoxList>
                        </div>
                    <div class="clear">
                    </div>
                </div>
                <div class="st-form-line-noleft">
                    <asp:Label ID="LabelServices" runat="server" Text="EOI Services" CssClass="st-labeltext level1 checked-box-list"
                        AssociatedControlID="CheckBoxListServices"></asp:Label><div class="st-forminput left check-box-list level2-5">
                            <asp:CheckBoxList ID="CheckBoxListServices" runat="server" DataTextField="ItemName"
                                DataValueField="Id">
                            </asp:CheckBoxList>
                        </div>
                    <div class="clear">
                    </div>
                </div>
            </asp:Panel>
            <%--BUSINESS LOOKUP--%><asp:Panel ID="DetailsPanel05" ClientIDMode="Static" runat="server">
                <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                    <ContentTemplate>
                    
                <div class="titleh">
                    <h3>
                        Current list of supporting materials <span class="right"><asp:HyperLink 
                                    ID="LinkCreate" runat="server" CssClass="hg-blue" 
                                    NavigateUrl="~/SupportingMaterials/AddASupportingMaterials.aspx">Create</asp:HyperLink><asp:CheckBox
                                ID="CheckBoxInactive" runat="server" Text="Include In-active" 
                                    AutoPostBack="True" oncheckedchanged="CheckBoxInactive_CheckedChanged" /></span>
                    </h3>
                </div>
                <asp:GridView ID="GridViewSupportingMaterials" CssClass="tablesorter" runat="server"
                    AutoGenerateColumns="False" AllowPaging="True" PageSize="15" 
                    AllowSorting="True" DataSourceID="ObjectDataSource1" 
                            onrowcreated="GridViewSupportingMaterials_RowCreated"><Columns>
                        <asp:TemplateField 
                                    HeaderText="URL" SortExpression="URL"><ItemTemplate><asp:LinkButton 
                                        ID="LinkButtonURL" runat="server" CausesValidation="false"
                                        CommandArgument='<%# Eval("IsActive").ToString() %>' 
                                        Text='<%# Eval("URL") %>' 
                                        CommandName='<%# Eval("SupportingMaterialId") %>' 
                                        oncommand="LinkButtonUrl_Command" ></asp:LinkButton></ItemTemplate></asp:TemplateField><asp:TemplateField  HeaderText="Description" SortExpression="Description">
                                    <ItemTemplate>
                                    <asp:Label ID="LabelDescription" 
                                            runat="server" Text='<%# Eval("Description") %>'></asp:Label></ItemTemplate></asp:TemplateField><asp:TemplateField 
                                    HeaderText="Type" SortExpression="Type">
                                    <ItemTemplate>
                                     <asp:Label ID="LabelType" 
                                            runat="server" Text='<%# Eval("Type") %>'></asp:Label></ItemTemplate></asp:TemplateField><asp:TemplateField 
                                    HeaderText="Added By" SortExpression="AddedBy"><ItemTemplate>
                            <%#String.Format("{0:dd/MM/yyyy}",Eval("AddedDate")) %>
                            </ItemTemplate><HeaderStyle CssClass="header" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Added Date" 
                                    SortExpression="AddedDate"><ItemTemplate><%#String.Format("{0:dd/MM/yyyy}",Eval("AddedDate")) %></ItemTemplate><HeaderStyle 
                                        CssClass="header" /><ItemTemplate><%#String.Format("{0:dd/MM/yyyy}",Eval("AddedDate")) %></ItemTemplate><HeaderStyle 
                                        CssClass="header" /><ItemTemplate><%#String.Format("{0:dd/MM/yyyy}",Eval("AddedDate")) %></ItemTemplate><HeaderStyle 
                                        CssClass="header" /></asp:TemplateField><asp:TemplateField HeaderText="Is Active" SortExpression="IsActive">
                            <ItemTemplate>
                                <asp:Label ID="LabelActive" runat="server" Text='<%#(bool)Eval("IsActive") ? "Yes" : "No"%>'></asp:Label></ItemTemplate><HeaderStyle CssClass="header" />
                         <HeaderStyle CssClass="header" />
                        </asp:TemplateField>


                         <asp:TemplateField HeaderText="">
                            <ItemTemplate>
                                <asp:HyperLink ID="HyperLinkEdit" runat="server" 
                                            NavigateUrl='<%# Eval("SupportingMaterialId","~/Organization/EditASupportingMaterials.aspx?id={0}") %>'>Edit</asp:HyperLink></ItemTemplate></asp:TemplateField></Columns><PagerStyle CssClass="pagination_table"></PagerStyle>
                </asp:GridView>
            


            <asp:ObjectDataSource 
                    ID="ObjectDataSource1" runat="server" 
                    SelectCountMethod="GetListSupportingMaterialCount" 
                    SelectMethod="GetListSupportingMaterial"
                    TypeName="AB.ServiceDirectory.BO.ASupportingMaterialBO" 
                    EnablePaging="True" MaximumRowsParameterName="maxRows" 
                    onselecting="ObjectDataSource1_Selecting" SortParameterName="sortType"></asp:ObjectDataSource>
                    </ContentTemplate>
                </asp:UpdatePanel>
                    </asp:Panel>
            <%--DIALOG BOX--%><%--ADDRESS - POSTCODE LOOKUP--%><%--CONTACT LOOKUP--%>
            <%--BUSINESS LOOKUP--%>
            <%--DIALOG BOX--%>
            
        </div>
    </div>
</asp:Content>
